package lzy.mapper;

import lzy.entity.GinsengTraceability;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface GinsengTraceabilityMapper {
    // 根据溯源码查询
    GinsengTraceability findByTraceCode(@Param("traceCode") String traceCode);
    
    // 根据批次号查询
    List<GinsengTraceability> findByBatchNo(@Param("batchNo") String batchNo);
    
    // 查询所有溯源记录
    List<GinsengTraceability> findAll();
    
    // 插入新的溯源记录
    int insert(GinsengTraceability record);
    
    // 更新溯源记录
    int update(GinsengTraceability record);
    
    // 删除溯源记录
    int delete(@Param("traceCode") String traceCode);
}